
public class CinemaItem {
	
	private int seatPerRow = MovieApp.seatPerRow;
	private SeatItem[][] seatList = new SeatItem[seatPerRow][seatPerRow];
	private int cinemaClass;
	private String cinemaName;
	// Constructor //
	public CinemaItem()
	{
		for (int i=0;i<seatPerRow;i++)
			for (int j = 0;j<seatPerRow; j++)
			{
				char ch = (char)(i+64);
				String temp = Integer.toString(j+1);
				temp = ch+temp;
				seatList[i][j] = new SeatItem(temp);
			}
	}

	public String getCinemaName()
	{
		return cinemaName;
	}
	
	public void setCinemaName(String cinemaName)
	{
		this.cinemaName= cinemaName;
	}

	public void unAssign(int i,int j)
	{
		seatList[i][j].unassign();
	}
	
	public void assignSeat(int i, int j)
	{
		seatList[i][j].assign();
	}
	
	public void printCinema()
	{
		System.out.println("=================Screen================ ");
		for (int i=0; i<seatPerRow+1;i++)
		{
			for (int j =0;j<seatPerRow+1;j++)
			{
				if(i==0 && j==0)
					System.out.print("  ");
				else if (j==0)
				{
					char ch = (char)(i+64);
					System.out.print(ch+" ");
				}
				else if (i==0)
					System.out.print(j + "  ");
					else
						if (seatList[i-1][j-1].isOccupied())
							System.out.print("[X]");
						else System.out.print("[ ]");
					
			}
		System.out.println();
		}
	}
	public SeatItem[][] getSeatList()
	{
		return seatList;
	}
	
	public void setCinemaClass(int cinemaClass)
	{
		this.cinemaClass=cinemaClass;
	}
	
	public int getCinemaClass()
	{
		return cinemaClass;
	}

		
	
}
	


